/**
 * 二维坐标点
 */
export interface Point {
    x: number
    y: number
}

/**
 * 二维坐标点元组
 */
export type PointTuple = [x: number, y: number]

/**
 * 返回字符串类型的大小写的联合类型
 */
export type LUString<T extends string> = Lowercase<T> | Uppercase<T>

/**
 * 基础命令类型
 */
export type BaseCommandType = 'm' | 'l' | 'h' | 'v' | 'a' | 'c' | 's' | 'q' | 't' | 'z'

/**
 * 命令类型
 */
export type CommandType = LUString<BaseCommandType> | 'AC' | 'AT' | 'E' | 'R' | 'RR'

export type MovePathCommand = ['m' | 'M', number, number]
export type LinePathCommand = ['l' | 'L', number, number]
export type HorizontalPathCommand = ['h' | 'H', number]
export type VerticalPathCommand = ['v' | 'V', number]
export type ArcPathCommand = ['a' | 'A', number, number, number, number, number, number, number]
export type CurvePathCommand = ['c' | 'C', number, number, number, number, number, number]
export type ShortCurvePathCommand = ['s' | 'S', number, number, number, number]
export type QuadraticCurvePathCommand = ['q' | 'Q', number, number, number, number]
export type ShortQuadraticCurvePathCommand = ['t' | 'T', number, number]
export type ClosePathCommand = ['z' | 'Z']
export type ArcCommand = ['AC', number, number, number, number, number, number]
export type ArcToCommand = ['AT', number, number, number, number, number]
export type EllipseCommand = ['E', number, number, number, number, number, number, number, number]
export type RectCommand = ['R', number, number, number, number]
export type RoundRectCommand = ['RR', number, number, number, number, number | number[]]

export type PathCommand =
    | MovePathCommand
    | LinePathCommand
    | HorizontalPathCommand
    | VerticalPathCommand
    | ArcPathCommand
    | CurvePathCommand
    | ShortCurvePathCommand
    | QuadraticCurvePathCommand
    | ShortQuadraticCurvePathCommand
    | ClosePathCommand
    | ArcCommand
    | ArcToCommand
    | EllipseCommand
    | RectCommand
    | RoundRectCommand
